{include file="public/header" /}
<form class="layui-form">
	<input type="hidden" name="uid" value="{$find['uid']}">
	<div class="layui-form-item">
		<label class="layui-form-label">手机号</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="phone" placeholder="请输入手机号" value="{$find['phone']}">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">密码</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="pwd" placeholder="请输入密码">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">昵称</label>
		<div class="layui-input-block">
			<input type="text" class="layui-input" name="nickname" placeholder="请输入昵称" value="{$find['nickname']}">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">性别</label>
		<div class="layui-input-block">
			<select name="sex">
				<option value="0" {$find['sex']==0?'selected':''}>保密</option>
				<option value="1" {$find['sex']==1?'selected':''}>男</option>
				<option value="2" {$find['sex']==2?'selected':''}>女</option>
			</select>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">状态</label>
		<div class="layui-input-block">
			<input type="radio" name="status" value="1" title="开启" {$find['status']==1?'checked':''}>
			<input type="radio" name="status" value="0" title="禁用" {$find['status']==0?'checked':''}>
		</div>
	</div>
</form>
<div class="layui-form-item" style="margin-top:10px;">
	<div class="layui-input-block">
		<button type="button" class="layui-btn" onclick="save()">保存</button>
	</div>
</div>
<script type="text/javascript">
	layui.use(['layer','form'],function(){
		var form = layui.form;
		layer = layui.layer;
		$ = layui.jquery;
	});

	function save(){
		$.post("{$config['admin_route']}oyk/user_edit",$('form').serialize(),function(res){
			if(res.code>0){
				layer.msg(res.msg,{'icon':2});
			}else{
				layer.msg(res.msg,{'icon':1});
				setTimeout(function(){parent.window.location.reload();},1000);
			}
		},'json');
	}
</script>
{include file="public/tail" /}